home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
batch
/
powerbat
/
diskinfo.pwr
< prev
next >
Wrap
Text File
|
1994-05-17
|
4KB
|
95 lines
Variable CurrClr,3
Variable Normal,1,1
Variable Off,1,2
Variable Work,255
Variable YLoc,2,3
Variable HLine,80,'├──────────────────────────────────────────────────────────────────────────────┤'
Variable Drives,26,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Variable OneDrive,25,'ACDEFGHIJKLMNOPQRSTUVWXYZ'
Variable DriveCtr,2,1
Variable TwoDrives,1,1
Variable CurrDrive,1
Variable CurrDir,80
Variable VolID,12
Variable DriveType,12
Variable TotSpace,12
Variable FreeSpace,12
Variable PctFull,12
Variable RtnCode,2
Variable DayOfWeek,9
Variable Month,2
Variable Day,2
Variable Year,4
Variable CurrTime,11
Variable Secs,2,0
Variable Ind,1
?Color Work,Work,CurrClr ;save the curr color
Cursor Off ;turn off the cursor
Clear 112,,,1
Box1 1,1,80,25,116 ;draw our main box
?Time CurrTime
WriteAt 65,1,CurrTime
?Date DayOfWeek,Month,Day,Year
Concat Work,' ',DayOfWeek,' ',Month,'/',Day
Concat Work,'/'
Concat Work,Year
WriteAt 2,1,Work
Center ' Disk Drive Status ',1 ;messages
Center ' Press Any Key ',25
Box4 9,10,73,12,30,,8 ;question box
WriteAt 10,11,'Does Your System Contain More Than 1 Floppy Drive ? (Y/N)',30
ReadYN '',Work,10
ClearBox 1,1,80,25,116 ;clear question box
WriteAt 2,2,'Drive Volume ID DriveType TotalSpace FreeSpace % Full'
Compare Work,'Y',,,DriveLoop
SetVar Drives,OneDrive ;adjust drive letters
Label DriveLoop
?Time CurrTime ;update our time
WriteAt 65,1,CurrTime ; on screen
MidString CurrDrive,Drives,DriveCtr,1 ;get our curr drive
?DriveExist CurrDrive,,NextDrive ;does it exist
?DiskInfo CurrDrive,VolID,DriveType ;get disk info
?DiskSpace CurrDrive,TotSpace,FreeSpace ;get space info
SetVar PctFull,TotSpace ;calc
Subtract PctFull,FreeSpace ; our
Divide PctFull,TotSpace,RtnCode,2 ; percent
Compare RtnCode,0,MathErr ; full
Multiply PctFull,100,RtnCode ;make percent
Compare RtnCode,0,,,NoErr
Label MathErr
SetVar PctFull,'??'
Label NoErr
?CurrDir CurrDrive,CurrDir ;find curr directory
WriteAt 1,YLoc,HLine,116 ;write a horiz line
Add YLoc,1
WriteAt 4,YLoc,CurrDrive,126
WriteAt 8,YLoc,VolID,126
WriteAt 21,YLoc,DriveType,126
WriteAt 35,YLoc,TotSpace,126
WriteAt 48,YLoc,FreeSpace,126
WriteAt 62,YLoc,PctFull,126
Add YLoc,1
WriteAt 2,YLoc,'Curr Dir:'
WriteAt 11,YLoc,CurrDir,126
Add YLoc,1
Label NextDrive
Compare YLoc,22,EndPgm,,EndPgm ;any more room
Compare CurrDrive,'Z',EndPgm,,EndPgm ;any more drives
Add DriveCtr,1 ;get next drive
GoTo DriveLoop
Label EndPgm
?Time CurrTime ;get curr time
WriteAt 65,1,CurrTime ;put to screen
Add Secs,1
Compare Secs,30,Quit ;do we give up
ReadKey Work,Ind,1 ;get a key, timeout each sec
Compare Work,'',,EndPgm,EndPgm ;did we timeout
Label Quit
Cursor Normal
Color CurrClr
Clear CurrClr,,,0